Add per-cron-job reasoning-effort override (mirror of the model override)#181
Open
serxa wants to merge 1 commit into
Open
Add per-cron-job reasoning-effort override (mirror of the model override)#181serxa wants to merge 1 commit into
serxa wants to merge 1 commit into
Conversation
…ide) Cron/hook turns run at the lower cron_effort while interactive sources keep the full effort, and a cron job can already override its model — but cron_effort is a single global knob, forcing trivial pollers and reasoning-heavy jobs to the same effort. Add a per-job effort field on CronJob (mirroring model), threaded as effort_override through run -> _run_inner -> _get_or_create_client into SessionSpec.effort (incl. the client-retry paths). Default "" keeps the source-based cron_effort; the override still passes through _effective_effort model-cap clamping and is backend-agnostic. Opt-in, no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cron/hook turns already run at the lower
cron_effort(interactive sources keep the fullagent.effort), and a cron job can already override itsmodelinjobs.yaml. Butcron_effortis a single global knob for all crons — trivial/mechanical jobs (health probes, pollers) and reasoning-heavy jobs (report drafting, triage) are forced to the same effort. You either keep it low (and the heavy jobs get starved) or high (and the cheap pollers burn tokens).Fix
Add a per-job
effort:field onCronJob, mirroring the existingmodel:override:CronJob.effort(+from_dict/save_jobsserialization).CronServicepassesjob.effort or Noneintorun_cron/run_persistent_cron.effort_overrideis threaded throughrun→_run_inner→_get_or_create_client, where it becomeseffort=effort_override or self._base_effort_for_source(...)in theSessionSpec(also applied on the two client-retry paths so it survives a mid-turn reconnect).Properties:
""falls back to the source-basedcron_effort.spec.effort, which the backend runs through_effective_effort(spec.effort, model), so a per-job value is model-cap clamped like the default. Backend-agnostic (singleSessionSpecconstruction point).Testing
Added
TestCronJobEffort(default,from_dict, and asave_jobs→load_jobsround-trip). Full suite:1551 passed, 2 skipped.